<div class="box box-primary">
    <?php echo form_open('', 'role="form"'); ?>
    <div class="box-body">
        <div class="form-group">
            <label for="category_name">分类名称</label>
            <input type="text" name="category_name" class="form-control" id="category_name" placeholder="分类名称"
                   value="<?php echo set_value('category_name', ($category ? $category->category_name : '')); ?>">
        </div>
        <div class="form-group">
            <label for="category_slug">分类目录</label>
            <input type="text" class="form-control" id="category_slug" name="category_slug" placeholder="分类目录（请用英文或者数字）"
                   value="<?php echo set_value('category_slug', ($category ? $category->category_slug : '')); ?>">
        </div>

        <div class="form-group">
            <label for="category_parent_id">分类关系</label>
            <?php echo form_dropdown('category_parent_id', array('' => '一级分类') + ($category_list ? $category_list : array()), ($category ? $category->category_parent_id : array()), 'class="form-control select2" id="category_parent_id"'); ?>
        </div>

        <div class="form-group">
            <label for="category_status">
                <input name="category_status"
                       id="category_status" <?php echo set_checkbox('category_status', 'confirm', ($category ? ($category->category_status ? TRUE : FALSE) : TRUE)) ?>
                       value="confirm"
                       type="checkbox" class="flat-red"> 启用分类?
            </label>
        </div>

    </div>

    <div class="box-footer">
        <button type="submit" class="btn btn-primary">提交</button>
    </div>
    <?php echo form_close(); ?>
</div>

